/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.javatrainning.hieptq.btvn2;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 *
 * @author Hiep
 */
public class Bai5 {
    public static void main(String[] args) throws FileNotFoundException, IOException {
        BufferedReader br=new BufferedReader(new FileReader("b5.txt"));
        String s=br.readLine();
        System.out.println("Moi ban nhap xau: "+s);
        int dema=0, demb=0, demc=0;
	int demA=0, demB=0, demC=0;
        for(int i=0;i<s.length();i++){
        if(s.charAt(i)=='A') demA++;
        if(s.charAt(i)=='B') demB++;
        if(s.charAt(i)=='C') demC++;
        if(s.charAt(i)=='a') dema++;
        if(s.charAt(i)=='b') demb++;
        if(s.charAt(i)=='c') demc++;
         }
        System.out.println("cau a:có "+demA+" chu A,co "+demB+" chu B,co "+demC+" chu C,co "+dema+" chu a,co "+demb+" chu b,co "+demc+" chu c");
        dema=0; demb=0; demc=0;
        demA=0; demB=0; demC=0;
        for(int i=0;i<s.length();i++){
        if(s.charAt(i)=='A') demA++;
        if(s.charAt(i)=='B') demB++;
        if(s.charAt(i)=='C') demC++;
        if(s.charAt(i)=='a') dema++;
        if(s.charAt(i)=='b') demb++;
        if(s.charAt(i)=='c') demc++;
          }
        System.out.println("cau b:co "+(demA+dema)+" chu(a,A),co "+(demB+demb)+" chu(b,B)co "+(demC+demc)+" chu(c,C)");
}
}
        

